package com.example.net.entity

import android.content.Context
import android.os.Parcel
import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.alibaba.android.arouter.launcher.ARouter
import com.example.net.ConstantValue
data class SimpleVideoEntity(
    val avatar_url: String?,
    val channelid: String?,
    val commentnum: Int,
    val ctime: String?,
    val description: String?,
    val group_id: String?,
    val id: Int,
    val image_url: String?,
    val item_id: String?,
    val name: String?,
    val playnum: Int,
    val preview_url: String?,
    val publish_time: String?,
    val title: String?,
    val userid: String?,
    val verifycode: String?,
    val videomainimag: String?,
    val videopath: String?
):Parcelable{
 

	constructor(parcel: Parcel):this(
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    )
    

	override fun writeToParcel(dest: Parcel, flags: Int) {
        dest.writeString(avatar_url)
        dest.writeString(channelid)
        dest.writeInt(commentnum)
        dest.writeString(ctime)
        dest.writeString(description)
        dest.writeString(group_id)
        dest.writeInt(id)
        dest.writeString(image_url)
        dest.writeString(item_id)
        dest.writeString(name)
        dest.writeInt(playnum)
        dest.writeString(preview_url)
        dest.writeString(publish_time)
        dest.writeString(title)
        dest.writeString(userid)
        dest.writeString(verifycode)
        dest.writeString(videomainimag)
        dest.writeString(videopath)
    }
    
    override fun describeContents(): Int {
        return 0
    }
    
    companion object CREATOR: Parcelable.Creator<SimpleVideoEntity> {
		override fun createFromParcel(source: Parcel): SimpleVideoEntity {
            return SimpleVideoEntity(source)
        }
        
        override fun newArray(size: Int): Array<SimpleVideoEntity?> {
            return arrayOfNulls(size)
        }
    }
    
    fun arout(context:Context){
        ARouter.getInstance().build(ConstantValue.VIDEO_DETAIL_PATH).withParcelable("data",this).navigation()
    }
    
   
}


